[@com.header _title="字典管理"]
<link rel="stylesheet" href="${base}/res/components/bootstrapvalidator/dist/css/bootstrapValidator.css"/>
<link rel="stylesheet" href="${base}/res/components/bootstrap-table/dist/bootstrap-table.min.css"/>
[/@com.header]
[@com.body]
<section class="content container-fluid">
    <div class="box box-info">
        <form class="form-horizontal" action="save" id="form-dict" onsubmit="return false">
            <input type="hidden" name="id" value="${entity.id}" />
            <div class="box-header with-border">
                <button type="submit" class="btn btn-info"><i class="fa fa-save"></i> 保存</button>
                <a href="index" class="btn btn-default"><i class="fa fa-undo"></i> 返回</a>
            </div>
            <div class="box-body">
                <div class="form-group">
                    <label for="name" class="col-sm-2 control-label">字典名称</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="name" id="name" placeholder="请输入字典名称" type="text"
                            required maxlength="20" value="${entity.name?html}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="dictKey" class="col-sm-2 control-label">字典key</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="dictKey" id="dictKey" placeholder="请输入字典key" type="text"
                            required maxlength="20" value="${entity.dictKey?html}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="notes" class="col-sm-2 control-label">备注</label>
                    <div class="col-sm-10">
                        <textarea class="form-control" name="notes" id="notes" placeholder="备注信息" >${entity.notes?html}</textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="box box-info ${entity.id?has_content?string("","hide")}" id="item-box">
        <div class="box-header with-border">
            <h3 class="box-title">字典项</h3>
            <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
            </div>
        </div>
        <div class="box-body">
            <form class="form-inline" id="form-search" onsubmit="return false">
                <input type="hidden" name="dictKey" id="item-dict-key" value="${entity.dictKey?html}">
                <button type="button" class="btn btn-info" id="item-add"><i class="fa fa-plus"></i> 添加</button>
                <button type="button" class="btn btn-primary" id="item-edit" data-table="#tblist"><i class="fa fa-edit"></i> 修改</button>
                <button type="button" class="btn btn-danger" l-remove data-table="#tblist" data-url="itemRemove"><i class="fa fa-trash"></i> 删除</button>
            </form>
            <table id="tblist" l-table l-table-form="#form-search" data-toolbar="#form-seardch" data-url='itemPage'>
                <thead>
                <tr>
                    <th data-checkbox="true">ID</th>
                    <th data-field="dictLabel">字典项标签</th>
                    <th data-field="dictValue">字典项值</th>
                    <th data-field="sort">排序</th>
                    <th data-field="notes">备注</th>
                    <th data-field="createTime" data-formatter="base.tableColDateTime">创建时间</th>
                </tr>
                </thead>
            </table>
        </div>
        <div class="modal fade" role="dialog" id="item-modal" data-backdrop="false">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">字典项信息</h4>
                    </div>
                    <div class="modal-body" id="item-body">
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" id="item-save">保存</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </div>
</section>
[/@com.body]
<script type="text/javascript" src="${base}/res/components/bootstrapvalidator/dist/js/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="${base}/res/components/bootstrapvalidator/dist/js/language/zh_CN.js"></script>
<script type="text/javascript" src="${base}/res/components/bootstrap-table/dist/bootstrap-table.min.js"></script>
<script type="text/javascript" src="${base}/res/components/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" src="${base}/res/js/system/dict.js"></script>
